package com.kexio.enterprise.governance.ratelimit.statistics;

import java.time.LocalDateTime;
import java.util.Map;

/**
 * 限流统计信息
 * 
 * @author Kexio
 * @since 1.0.0
 */
public class RateLimitStatistics {
    private String key;
    private long totalRequests;
    private long allowedRequests;
    private long rejectedRequests;
    private double allowRate;
    private double averageWaitTime;
    private long maxWaitTime;
    private LocalDateTime startTime;
    private LocalDateTime lastRequestTime;
    private long currentAvailableTokens;
    private Map<String, Long> hourlyStats; // 小时统计

    // Getters and Setters
    public String getKey() { return key; }
    public void setKey(String key) { this.key = key; }
    
    public long getTotalRequests() { return totalRequests; }
    public void setTotalRequests(long totalRequests) { this.totalRequests = totalRequests; }
    
    public long getAllowedRequests() { return allowedRequests; }
    public void setAllowedRequests(long allowedRequests) { this.allowedRequests = allowedRequests; }
    
    public long getRejectedRequests() { return rejectedRequests; }
    public void setRejectedRequests(long rejectedRequests) { this.rejectedRequests = rejectedRequests; }
    
    public double getAllowRate() { return allowRate; }
    public void setAllowRate(double allowRate) { this.allowRate = allowRate; }
    
    public double getAverageWaitTime() { return averageWaitTime; }
    public void setAverageWaitTime(double averageWaitTime) { this.averageWaitTime = averageWaitTime; }
    
    public long getMaxWaitTime() { return maxWaitTime; }
    public void setMaxWaitTime(long maxWaitTime) { this.maxWaitTime = maxWaitTime; }
    
    public LocalDateTime getStartTime() { return startTime; }
    public void setStartTime(LocalDateTime startTime) { this.startTime = startTime; }
    
    public LocalDateTime getLastRequestTime() { return lastRequestTime; }
    public void setLastRequestTime(LocalDateTime lastRequestTime) { this.lastRequestTime = lastRequestTime; }
    
    public long getCurrentAvailableTokens() { return currentAvailableTokens; }
    public void setCurrentAvailableTokens(long currentAvailableTokens) { this.currentAvailableTokens = currentAvailableTokens; }
    
    public Map<String, Long> getHourlyStats() { return hourlyStats; }
    public void setHourlyStats(Map<String, Long> hourlyStats) { this.hourlyStats = hourlyStats; }
}
